package mock.bindtest.impl
{
	import mock.bindtest.Bind1;
	import mock.bindtest.Bind2;
	import mock.bindtest.Bind3;

	public class Bind1Impl implements Bind1
	{
		public function Bind1Impl()
		{
		}
		
		[Inject(name="p1")]
		public var param1:String;
		
		[Inject]
		public var typedBind2:Bind2;

		[Inject(name="b2")]
		public var namedBind2:Bind2;
		
		private var _typedBind3:Bind3;
		
		private var _namedBind3:Bind3;
		
		public var initialized:Boolean;
		[Inject]
		public function set typedBind3(value:Bind3):void{
			_typedBind3 =value;			 
		}
		
		[Inject("b3")]
		public function set namedBind3(value:Bind3):void{
			_namedBind3 =value;			 
		}

		public function get typedBind3():Bind3{
			return _typedBind3;			 
		}
		
		public function get namedBind3():Bind3{
			return _namedBind3;
		}
		
		[Init]
		public function doInit():void{
			if(param1 != null && typedBind2 != null && namedBind2 != null
			&& _typedBind3 != null && _namedBind3 != null){
				initialized = true;
				return;
			}
			throw new Error("init error");
		}
	}
}